function normal(data:Object, context:Object):Object
{	
	var voData:Object=new Object();

	voData.content=relatedInfoExpand(data, context.albumDetails, context.selectedAlbumId, context.chapterListNames, context.slot, context.uri);
	voData.type="doWrapper";
	
	return voData;
}

function relatedInfoExpand(data:Object, albumDetails:Object, selectedAlbumId:String, chapterListNames:Object, slot:String, uri:String):Object
{
	var content:Object=new Object();
	
	for (var i=0; i<albumDetails.count; i++)
	{
		if (albumDetails.objects[i].recordAlbumId==Number(selectedAlbumId))
		{
			var selectedAlbum=albumDetails.objects[i];
			content.albumName=selectedAlbum.name;
			content.creator=selectedAlbum["member.nickName"];
			content.createTime=selectedAlbum.createTime;
			content.members=selectedAlbum.members;
			content.scope=selectedAlbum.publicFlag;
			content.collab=selectedAlbum.collabFlag;
			content.des=selectedAlbum.intro;
			content.albumRate=selectedAlbum.albumRating;
			content.expect=selectedAlbum.expectRate;
			content.activeLevel=selectedAlbum.activeLevel;

			break;
		}
	}

	var taskStatusML2:String="";
	chapterListNames.objects.reverse();
	for (var i=0; i<chapterListNames.count; i++)
	{
		taskStatusML2+=getChapterNamesByTaskStatus(chapterListNames.objects[i], data, slot);
	}

	var ml2fileStr:String="";
	ml2fileStr+="<moonlight name='"+slot+"' template='"+slot+"-chapterListContainer' uri='"+uri+"'>";
	ml2fileStr+=taskStatusML2;
	ml2fileStr+="</moonlight>";

	content.tasks=new Object();	// ml2 template item
	content.tasks.type="ml2ti";
	content.tasks.template=slot+"-chapterListContainer";
	content.tasks.data=ml2fileStr;
/*
	for (var a in content)
	{
		Packages.log(a+": "+content[a], "debug");
	}
	 Packages.log("value: "+content.tasks.data, "debug");
*/
	return content;
}

function getChapterNamesByTaskStatus(item:Object, taskStatus:Object, slot:String):String
{
	var chapterItem=new Object();
	chapterItem.chapterId=item.chapterId;
	chapterItem.name=item.name;
	chapterItem.status="0";
	
	for (var i=0; i<taskStatus.count; i++)
	{
		if (taskStatus.objects[i]["chapter.chapterId"]==item.chapterId)
		{
			chapterItem.status=taskStatus.objects[i].status;
			break;
		}
	}	

	return getChapterItem(chapterItem, slot);
}

function getChapterItem(item:Object, slot:String):String
{
	// TODO: condition - item.status
	var textColor;
	if (item.status=="0") textColor=0xcccccc;
	else if (item.status=="1") textColor=0x999999;
	else if (item.status=="2") textColor=0x666666;
	else if (item.status=="3") textColor=0x333333;
	else if (item.status=="4") textColor=0x000000;
	
	var cont:String;
	cont="<portlet name="+"'chapterItem_"+item.chapterId+"' drag='no' height='25'>";	
	cont+="<textfield name='chapterName_"+item.chapterId+"' x='5' y='0' html='true' selectable='no' width='300' height='20' textColor='"+textColor+"'>"
			//+Packages.system.utils.TextUtil.formatText("tfContent", item.name)+"</textfield>";
			+item.name+"</textfield>";
	cont+="<hotspot name='cItem"+item.chapterId+"' x='5' y='0' width='310' height='20' alpha='0'/>";
	cont+="<handler ins='"+slot+"-cItem"+item.chapterId+"' type='onRollOver' src='lib:notes.system.events.StateFulButtonEvent.invokeRollOverEvent'/>";
	cont+="<handler ins='"+slot+"-cItem"+item.chapterId+"' type='onRollOut' src='lib:notes.system.events.StateFulButtonEvent.invokeRollOutEvent'/>";
	cont+="<handler ins='"+slot+"-cItem"+item.chapterId+"' type='onPress' src='lib:notes.system.events.StateFulButtonEvent.invokePressEvent'/>";
	cont+="<handler ins='"+slot+"-cItem"+item.chapterId+"' type='onRelease' src='lib:notes.system.events.StateFulButtonEvent.invokeReleaseEvent'/>";
	cont+="<handler ins='"+slot+"-cItem"+item.chapterId+"' type='onReleaseOutside' src='lib:notes.system.events.StateFulButtonEvent.invokeRollOutEvent'/>";
	cont+="</portlet>";

	// Packages.log("content:"+cont, "debug");
	return cont;
}